#include <cassert>
#include "../include/json_writer.hpp"

namespace alexcr4ckpentest
{
  JsonWriter::JsonWriter() noexcept {}
  JsonWriter::JsonWriter(const std::string& filename) : m_filename{filename} {}

  void JsonWriter::write(const nlohmann::json& json_format_text) noexcept
  {
    m_out_file_stream.open(m_filename);

    assert(m_out_file_stream.is_open());

    m_out_file_stream << json_format_text.dump(4);

    m_out_file_stream.close();
  }
} // namespace alexcr4ckpentest
